package com.seu.spring.interceptor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * 通用日志处理
 *
 * @author liangfeihu
 * @since 2018/12/28
 */
public class LogInterceptor implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println(invocation.getMethod().getName() + " method start");
        Object obj = invocation.proceed();
        System.out.println(invocation.getMethod().getName() + " method end");
        return obj;
    }
}